import pygame
import sys
import time
#Iniciar pygame
pygame.init()

# Configurar la ventana
ancho = 1270
alto = 1000
ventana = pygame.display.set_mode((ancho, alto))
pygame.display.set_caption('Hola Mundo')

luna = pygame.image.load("img/gran_luna.jpg")
x_fondo,y_fondo = 0,0
ventana.blit(luna, (0,0))
pygame.display.flip()

#persona 1
agente = pygame.image.load("img/deadeyejoe.png")
x,y = 100,200
ventana.blit(agente, [x,y])
pygame.display.flip()
pygame.display.update()

#persona 2
nave = pygame.image.load("img/desertcore.png")
x,y = 200,100
ventana.blit(nave ,[x,y])
pygame.display.flip()
pygame.display.update()

#bucle de evento
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

#configurar el tipo de letra
tamanio = 48
fuente = pygame.font.Sysfont("guerra espacial", tamanio)

#agente controles
		if event.key == pygame.key.K_RIGHT:
			ventana.blit(gran_luna, [0,0])
			x = x + 5
			ventana.blit(agente, [x,y])
			pygame.display.flip()
			pygame.display.update()
        
        if event.key == pygame.key.K_LEFT:
			ventana.blit(gran_luna, [0,0]
			x = x - 5
			ventana.blit(gran_luna, [x,y]
			pygame.display.flip()
			pygame.display.update()
	
	    if event.key == pygame.key.K_DOWN
	        ventana.blit(gran_luna, [0,0]
            y = y - 5
	        ventana.blit(gran_luna,[x,y]
	        pygame.display.flip()
	        pygame.display.update()
	
	    if event.key == pygame.key.K_UP
	        ventana.blit(gran_luna, [0,0]
	        y = y + 5
	        ventana.blit(gran_luna,[x,y]
	        pygame.display.flip()
	        pygame.display.update()

